#include "stdafx.h"
#include "Root.h"

namespace GMotor
{
	Root::Root(void)
	{
		//Crea los logs
		this->mLogManager = new StdTools::LogManager();
		this->mLogManager->create("GMotor.log",true,true);
		this->mLogManager->systemLogMessage("Iniciando GMotor...");

		//Crea los recursos
		this->mLogManager->systemLogMessage("Creando recursos del sistema...");
		this->mResourcesManager = new ResourcesManager(this->mLogManager);
		this->mLogManager->systemLogMessage("Recursos creados.");
	}


	Root::~Root(void)
	{
		this->mLogManager->systemLogMessage("Eliminando GMotor...");

		//Elimina los recursos
		this->mLogManager->systemLogMessage("Eliminando recursos del sistema...");
		delete this->mResourcesManager;
		this->mLogManager->systemLogMessage("Recursos eliminados.");

		this->mLogManager->systemLogMessage("Eliminado GMotor.");

		//Elimina los logs
		delete this->mLogManager;
	}

	ResourcesManager * Root::getResourcesManager()
	{
		return this->mResourcesManager;
	}
}
